<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta charset="utf-8"/>
    <title>EasyWeb</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="assets/css/admin.css"/>
    <link rel="stylesheet" href="module/formSelects/formSelects-v4.css"/>
</head>

<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 头部 -->
    <div class="layui-header" p-com="header"></div>

    <!-- 侧边栏 -->
    <div class="layui-side" p-com="side"></div>

    <!-- 主体部分 -->
    <div class="layui-body"></div>

    <!-- 底部 -->
    <div class="layui-footer">Copyright © 2018 EasyWeb All rights reserved. <span class="pull-right">Version 2.0</span>
    </div>

    <!-- 手机屏幕遮罩层 -->
    <div class="site-mobile-shade"></div>
</div>

<script type="text/javascript" src="assets/libs/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="assets/libs/q.js"></script>
<script type="text/javascript" src="assets/libs/pandyle.min.js"></script>
<script type="text/javascript" src="assets/libs/layui/layui.js"></script>

<script>
    layui.config({
        base: 'module/'
    }).extend({
        formSelects: 'formSelects/formSelects-v4'
    }).use(['config', 'index', 'element'], function () {
        var config = layui.config;
        var index = layui.index;
        var element = layui.element;

        // 检查是否登录
        if (!config.getToken() || config.getToken() == '') {
            location.replace('login.html');
            return;
        }
        // 获取当前用户信息
        index.getUser(function (user) {
            $('.layui-layout-admin .layui-header').vm(user);
            index.initLeftNav();
            element.render('nav');
            index.initRouter();
            index.bindEvent();
        });

    });
</script>
</body>

</html>